<!doctype html>
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
         language="java" %>
<%@ include file="/jsp/mobile/include/include.jsp" %>
<%
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragrma", "no-cache");
    response.setDateHeader("Expires", 0);
%>
<html lang="cn">
<head>
    <%@ include file="/jsp/mobile/include/header.jsp" %>
    <script src="<%=request.getContextPath()%>/script/fastclick.js"></script>
    <title>扫码支付</title>
</head>
<body style="background: #f2f2f2;">
<%--<div class="head">--%>
<%--<div class="auto">--%>
<%--<span class="tit">扫码支付</span>--%>
<%--<a class="return">--%>
<%--<i class="ico ico1"></i>--%>
<%--返回--%>
<%--</a>--%>
<%--</div>--%>
<%--</div>--%>
<div class="main" id ="main">
    <div class="inSum" style="top:0px;">
        <p class="ti">人民币/￥</p>

        <p class="ci" id="inputAmt">0.00</p>
    </div>
    <div class="tpXs">
        <p>温馨提示：</p>

        <p>1.同时支持支付宝，微信扫码收款（可支付信用卡）</p>

        <p>2.支付限额以官方最新公布为基准：<a href="<%=request.getContextPath()%>/mobile/index/payamtlimit" class="underline" style="color:#2486fa;">限额表</a></p>

        <p>3.扫码收款仅针对真实商家或个人收款</p>
        <!-- <p>3.支付手续费：0.35% (支付宝0.6%) </p> -->
    </div>
    <div class="inPt">
        <table >
            <tbody>
            <tr>
                <td width="25%"><span>7</span></td>
                <td width="25%"><span>8</span></td>
                <td width="25%"><span>9</span></td>
                <td width="25%"><span ><i class="icov icov3"/></span></td>
            </tr>
            <tr>
                <td width="25%"><span>4</span></td>
                <td width="25%"><span>5</span></td>
                <td width="25%"><span>6</span></td>
                <td width="25%" rowspan="3" id="confirmAmt" style="text-align: center"><img  src="../../images/mobile/paycode_1.png"/></td>
            </tr>
            <tr>
                <td width="25%"><span>1</span></td>
                <td width="25%"><span>2</span></td>
                <td width="25%"><span>3</span></td>
            </tr>
            <tr>
                <td width="25%"><span>0</span></td>
                <td width="25%"><span>.</span></td>
                <td width="25%"><span>00</span></td>
            </tr>
            </tbody>
        </table>
    </div>
    <form id="incomeForm" action="<%=request.getContextPath()%>/mobile/index/incomeGetPay">
        <input id="incomeAmt" name="incomeAmt" type="hidden" value="0.00">
    </form>
    <input id="originalStatus" name="originalStatus" type="hidden" value="1"> <!--是否为原始状态-->
</div>

</body>
<script type="text/javascript">
    //-->
    $(function () {
        FastClick.attach(document.body);
        var _height =  document.documentElement.clientHeight;   //获取整体高度
        $("#main").css("height",_height);
        changeStyleByValue();
    });
    $("td span").bind("click", function () {
        var _amt = $("#inputAmt").text();
        var _originalStatus = $("#originalStatus").val();
        var _back = $(this).has("i").length;//有 i标签为回退键
        if (_back) {
            //如果删除到最后数值则一直保持0.00
            if (_amt.length <= 1 || _amt == '0.00') {
                $("#originalStatus").val("1"); //保持为原始状态
                setDealAmt("0.00");
            } else {
                setDealAmt(_amt.substr(0, _amt.length - 1));
            }

        } else {
                var _value = $(this).text();
                if (_originalStatus == "1" || _amt == '0.00')//如果为原始状态 需要0.00清掉 同时设置为已改动
                {
                    setDealAmt(_value);
                    $("#originalStatus").val("0");
                } else {
                    setDealAmt(_amt + _value);
                }
        }
    });

    function setDealAmt(amt) {
        $("#inputAmt").text(amt);
        $("#incomeAmt").val(amt);
        changeStyleByValue();
    }

    function income() {
        $("#incomeForm").submit();
    }

    function changeStyleByValue() {
        var _amt = $("#incomeAmt").val();
        if (checkPrice(_amt) && parseFloat(_amt) > 0) {
            $("#confirmAmt").css("background","#d81e06").attr("onclick", "javascript:income();");
        } else {
            $("#confirmAmt").css("background","#bfbfbf").removeAttr("onClick");
        }
    }
</script>
</html>